package org.jeecg.modules.demo.zjzx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.demo.zjzx.entity.ZwglExpertInformation;
import org.jeecg.modules.demo.zjzx.entity.ZwglZjhd;
import org.jeecg.modules.demo.zjzx.mapper.ZwglExpertInformationMapper;
import org.jeecg.modules.demo.zjzx.service.IZwglExpertInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 专家信息
 * @Author: jeecg-boot
 * @Date:   2023-04-20
 * @Version: V1.0
 */
@Service
public class ZwglExpertInformationServiceImpl extends ServiceImpl<ZwglExpertInformationMapper, ZwglExpertInformation> implements IZwglExpertInformationService {

    @Autowired
    private ZwglZjhdServiceImpl zwglZjhdService;
    @Override
    public Map<String, Object> myList() {
        Map<String, Object> map=new HashMap<>();
        QueryWrapper<ZwglExpertInformation> wrapper=new QueryWrapper<>();
        wrapper.eq("yes_status",1);
        List<ZwglExpertInformation> list = list();
        map.put("list",list);
        map.put("count",list.size()==0?0:list.size());
        List<ZwglZjhd> answers = zwglZjhdService.list();
        map.put("answersCount",answers.size()==0?0:answers.size());

        return map;
    }
}
